home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiTCP30b2.lha / netinclude / net / if_arp.h < prev    next >
C/C++ Source or Header  |  1994-02-04  |  4KB  |  115 lines

  1. #ifndef NET_IF_ARP_H
  2. #define NET_IF_ARP_H
  3. /*
  4. **      $Filename: net/if_arp.h $
  5. **    $Release$
  6. **      $Revision: 3.1 $
  7. **      $Date: 1994/02/03 19:18:17 $
  8. **
  9. **    Interface to the Address Resolution Protocol
  10. **
  11. **    Copyright © 1993,1994 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  12. **                  Helsinki University of Technology, Finland.
  13. **                  All rights reserved.
  14. */
  15.  
  16. /*
  17.  * Address Resolution Protocol.
  18.  *
  19.  * See RFC 826 for protocol description.  ARP packets are variable
  20.  * in size; the arphdr structure defines the fixed-length portion.
  21.  * Protocol type values are the same as those for 10 Mb/s Ethernet.
  22.  * It is followed by the variable-sized fields ar_sha, arp_spa,
  23.  * arp_tha and arp_tpa in that order, according to the lengths
  24.  * specified.  Field names used correspond to RFC 826.
  25.  */
  26. struct    arphdr {
  27.     u_short    ar_hrd;        /* format of hardware address */
  28. #define ARPHRD_ETHER     1    /* ethernet hardware address */
  29. #define ARPHRD_ARCNET     7    /* ARCNET hardware address */
  30.     u_short    ar_pro;        /* format of protocol address */
  31.     u_char    ar_hln;        /* length of hardware address */
  32.     u_char    ar_pln;        /* length of protocol address */
  33.     u_short    ar_op;        /* one of: */
  34. #define    ARPOP_REQUEST    1    /* request to resolve address */
  35. #define    ARPOP_REPLY    2    /* response to previous request */
  36. /*
  37.  * The remaining fields are variable in size,
  38.  * according to the sizes above.
  39.  */
  40. /*    u_char    ar_sha[];    \* sender hardware address */
  41. /*    u_char    ar_spa[];    \* sender protocol address */
  42. /*    u_char    ar_tha[];    \* target hardware address */
  43. /*    u_char    ar_tpa[];    \* target protocol address */
  44. };
  45.  
  46. #define MAXADDRARP  16          /* Maximum number of octets in hw address */
  47.  
  48. /*
  49.  * ARP ioctl request. 
  50.  */
  51. struct arpreq {
  52.     struct    sockaddr arp_pa;        /* protocol address */
  53.     struct    {                        /* hardware address */
  54.       u_char sa_len;
  55.       u_char sa_family;        
  56.       char     sa_data[MAXADDRARP];        
  57.     }  arp_ha;        
  58.     int    arp_flags;            /* flags */
  59. };
  60.  
  61. /*  arp_flags and at_flags field values */
  62. #define    ATF_INUSE    0x01    /* entry in use */
  63. #define ATF_COM        0x02    /* completed entry (enaddr valid) */
  64. #define    ATF_PERM    0x04    /* permanent entry */
  65. #define    ATF_PUBL    0x08    /* publish entry (respond for other host) */
  66. #define    ATF_USETRAILERS    0x10    /* has requested trailers */
  67.  
  68. /* 
  69.  * An AmiTCP/IP specific ARP table ioctl request
  70.  */
  71. struct arptabreq {
  72.     struct arpreq  atr_arpreq; /* We want to identify the interface */
  73.     long           atr_size;          /* # of elements in art_table */
  74.     long           atr_inuse;               /* # of elements in use */
  75.     struct arpreq *atr_table;
  76. };
  77.  
  78. /*
  79.  * Copyright (c) 1986 Regents of the University of California.
  80.  * All rights reserved.
  81.  *
  82.  * Redistribution and use in source and binary forms, with or without
  83.  * modification, are permitted provided that the following conditions
  84.  * are met:
  85.  * 1. Redistributions of source code must retain the above copyright
  86.  *    notice, this list of conditions and the following disclaimer.
  87.  * 2. Redistributions in binary form must reproduce the above copyright
  88.  *    notice, this list of conditions and the following disclaimer in the
  89.  *    documentation and/or other materials provided with the distribution.
  90.  * 3. All advertising materials mentioning features or use of this software
  91.  *    must display the following acknowledgement:
  92.  *    This product includes software developed by the University of
  93.  *    California, Berkeley and its contributors.
  94.  * 4. Neither the name of the University nor the names of its contributors
  95.  *    may be used to endorse or promote products derived from this software
  96.  *    without specific prior written permission.
  97.  *
  98.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  99.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  100.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  101.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  102.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  103.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  104.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  105.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  106.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  107.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  108.  * SUCH DAMAGE.
  109.  *
  110.  *    @(#)if_arp.h    7.4 (Berkeley) 6/28/90
  111.  */
  112. #endif /* NET_IF_ARP_H */
  113.  
  114.  
  115.